﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Should;

namespace NGeo.Yahoo.GeoPlanet
{
    [TestClass]
    public class ConsumeGeoPlanetTests
    {
        [TestMethod]
        public void Yahoo_GeoPlanet_Place_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Place(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<RequestView>()))
                .Returns(new Place());
            var results = contract.Object.Place(0, null);
            results.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Parent_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Parent(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<RequestView>()))
                .Returns(new Place());
            var result = contract.Object.Parent(0, null);
            result.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Ancestors_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Ancestors(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<RequestView>()))
                .Returns(new Places());
            var result = contract.Object.Ancestors(0, null);
            result.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Types_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Types(It.IsAny<string>(), It.IsAny<RequestView>()))
                .Returns(new PlaceTypes());
            var result = contract.Object.Types(null);
            result.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Countries_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Countries(It.IsAny<string>(), It.IsAny<RequestView>()))
                .Returns(new Places());
            var result = contract.Object.Countries(null);
            result.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Concordance_WithStringId_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Concordance(It.IsAny<ConcordanceNameSpace>(), It.IsAny<string>(), It.IsAny<string>()))
                .Returns(new ConcordanceResponse());
            var result = contract.Object.Concordance(default(ConcordanceNameSpace), null, null);
            result.ShouldNotBeNull();
        }

        [TestMethod]
        public void Yahoo_GeoPlanet_Concordance_WithIntId_ShouldBeInterfaceMethod()
        {
            var contract = new Mock<IConsumeGeoPlanet>();
            contract.Setup(m => m.Concordance(It.IsAny<ConcordanceNameSpace>(), It.IsAny<int>(), It.IsAny<string>()))
                .Returns(new ConcordanceResponse());
            var result = contract.Object.Concordance(default(ConcordanceNameSpace), 0, null);
            result.ShouldNotBeNull();
        }

    }
}
